#include <stdio.h>

int main() {
    float fee, dist, discount, price, weight;
    int grade;

    printf("Distance Price Weight:");
    scanf("%f %f %f", &dist, &price, &weight);
    
    if (dist < 0) {
        printf("Error!");
        return 0;
    }

    grade = (int)(dist / 250.0); 
    switch(grade) {
        case 0: discount = 0; break;
        case 1: discount = 0.02; break;
        case 2: discount = 0.05; break;
        case 3: 
        case 4: discount = 0.08; break;
        case 5: 
        case 6:
        case 7:
        case 8: discount = 0.10; break;
        case 9: 
        case 10: 
        case 11: 
        default: discount = 0.15; break;
    }

    fee = price * weight * dist * (1 - discount);
    printf("Fee: %f\n", fee);

    return 0;
}
